package com.mindbook.pblcbl.controller;

import com.mindbook.pblcbl.entity.user.RoleFunctionAssociation;
import com.mindbook.pblcbl.mapper.user.RoleFunctionAssociationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author wxb
 * @Datatime 2020/3/5 19:36
 * @Descript
 */
@RestController
@RequestMapping("rfa")
public class RoleFunctionAssociationController {

    @Autowired private RoleFunctionAssociationMapper roleFunctionAssociationMapper;

    @GetMapping("insert")
    public String insertList(){
        List<RoleFunctionAssociation> list = new ArrayList<>();
        RoleFunctionAssociation roleFunctionAssociation = null;
        for (int i=0;i<5;i++) {
            roleFunctionAssociation =new RoleFunctionAssociation();
            roleFunctionAssociation.setId(i);
            roleFunctionAssociation.setRoleId(i);
            list.add(roleFunctionAssociation);
        }
        int i = roleFunctionAssociationMapper.insertList(list);
        return i+"";
    }

}
